<%-- 
    Document   : login
    Created on : Oct 24, 2011, 6:59:26 PM
    Author     : Group 106
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript">

    function checkInputData()
    {
        if(document.login.email.value == ""){
            alert("You must input Email!");
            document.login.email.focus();
            return false;
        }
        if(document.login.password.value == ""){
            alert("You must input Password!");
            document.login.password.focus();
            return false;
        }
        return true;
    }
</script>

<html >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Login Page </title>
        <meta name="keywords" content="my sweet home, real estate website, website my home, msh, CSS, XHTML" />
        <meta name="description" content="Real Estate , website eproject of Aptech" />
        <link href="CSS/msh_style.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="CSS/gallery_style.css" />
    </head>
    <%
                if (request.getSession().getAttribute("user") != null) {
                    response.sendRedirect("index.jsp");
                } else {
    %>
    <body>
        <div id="msh_container">
            <div id="msh_top_panel">
                <div id="msh_header_section">
                    <div id="msh_header"></div>
                </div> <!-- end of header section -->
                <div id="msh_menu_login_section">
                    <div id="msh_menu_section">
                        <div id="msh_menu_panel">
                            <ul>
                                <li><a href="home.jsp" class="current">Home</a></li>
                                <li><a href="register.jsp">Register</a></li>
                                <li><a href="#">About</a></li>
                                <li><a href="faq.jsp">FAQs</a></li>
                                <li><a href="#">Contact</a></li>
                            </ul>
                        </div> <!-- end of menu -->
                    </div>

                </div> <!-- end of menu login section -->
            </div> <!-- end of top panel -->

            <div id="msh_gallery_panel">
                <div id="gallery">
                    <div id="imagearea">
                        <div id="image">
                            <a href="javascript:slideShow.nav(-1)" class="imgnav " id="previmg"></a>
                            <a href="javascript:slideShow.nav(1)" class="imgnav " id="nextimg"></a>
                        </div>
                    </div>
                    <div id="thumbwrapper">
                        <div id="thumbarea">
                            <ul id="thumbs">
                                <li value="1"><img src="images/thumbs/1.jpg" width="179" height="100" alt="" /></li>
                                <li value="2"><img src="images/thumbs/2.jpg" width="179" height="100" alt="" /></li>
                                <li value="3"><img src="images/thumbs/3.jpg" width="179" height="100" alt="" /></li>
                                <li value="4"><img src="images/thumbs/4.jpg" width="179" height="100" alt="" /></li>
                                <li value="5"><img src="images/thumbs/5.jpg" width="179" height="100" alt="" /></li>
                                <li value="3"><img src="images/thumbs/3.jpg" width="179" height="100" alt="" /></li>
                                <li value="4"><img src="images/thumbs/4.jpg" width="179" height="100" alt="" /></li>
                                <li value="5"><img src="images/thumbs/5.jpg" width="179" height="100" alt="" /></li>
                            </ul>
                        </div>
                    </div>
                </div>

                <script type="text/javascript">
                    var imgid = 'image';
                    var imgdir = 'images/fullsize';
                    var imgext = '.jpg';
                    var thumbid = 'thumbs';
                    var auto = true;
                    var autodelay = 5;
                </script>
                <script type="text/javascript" src="JS/slide.js"></script>

            </div>

            <!--End #header-->
            <div id="msh_news_section" align="center">
                <h2>Account Login</h2>
                <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
                <div class="msh_news_box">

                    <div class="clear_with_heght"></div><!--End .clear-->

                    <form name="login" id="login" action="userLogin.do" method="post" onsubmit="return checkInputData()">
                        <%
                                            com.aptech.model.User objUser = new com.aptech.model.User();
                                            if (session.getAttribute("loginFail") != null) {
                                                session.setAttribute("loginFail", null);
                        %>
                        <table width="50%" height=30" align="center">
                            <tr>
                                <td align="center"> <h3> <p align="center" style="color:#FF0000"> Invalid email or password</p> </h3></td>
                            </tr>
                        </table>
                        <%
                                            }
                        %>
                        <table id="frmLogin">
                            <tr> <td id="div_email"><label>Email Address: </label>  </td> <td id="userEmail"><input type="text" id="email" name="userEmail" class="required" onclick="value:''" /> </td>  </tr>
                            <tr class="clear"></tr>
                            <tr> <td id="div_password"><label>Password: </label> </td> <td id="userPassword"><input type="password" id="password" name="userPassword" class="required" onclick="value:''" /> </td>  </tr>
                            <tr class="clear"></tr>
                        </table>
                        <input type="submit" value="Login" name="btnLogin"/>
                    </form>
                </div>
            </div><!-- end of news section -->
            <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
            <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
            <div id="msh_footer_panel">
                Copyright © 2011 <a href="aptech.vn">Ha Noi - Aptech</a> | <a href="home.jsp" target="_parent">Website My Sweet Home</a> by <a href="home.jsp" target="_blank">Group 106</a>
            </div>
        </div>
    </body>
    <% }%>
</html>
